home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / util / misc / Fudgit233.lha / Source / src / readline / readline.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-14  |  9.3 KB  |  248 lines

  1. /* Readline.h -- the names of functions callable from within readline. */
  2.  
  3. #ifndef _READLINE_H_
  4. #define _READLINE_H_
  5.  
  6. #include "keymaps.h"
  7.  
  8. #ifndef __FUNCTION_DEF
  9. typedef int Function ();
  10. typedef int KFunction (int, int);
  11. typedef void VFunction (char *);
  12. typedef char *CFunction (char *, int);
  13. typedef void CCFunction (char **);
  14. #define __FUNCTION_DEF
  15. #endif
  16. typedef char *UFunction(char *, int, int);
  17.  
  18.  
  19. /* The functions for manipulating the text of the line within readline.
  20. Most of these functions are bound to keys by default. */
  21. extern void rl_beg_of_line (int dum1, int dum2),
  22.   rl_backward (int count, int dum2),
  23.   rl_delete (int count, int invoking_key),
  24.   rl_end_of_line (int dum1, int dum2),
  25.   rl_forward (int count, int dum2),
  26.   rl_backward (int count, int dum2),
  27.   rl_newline (int count, int key),
  28.   rl_kill_line (int direction, int dum2),
  29.   rl_clear_screen (int dum1, int dum2),
  30.   rl_get_next_history (int count, int dum2),
  31.   rl_get_previous_history (int count, int dum2),
  32.   rl_reverse_search_history (int sign, int key),
  33.   rl_transpose_chars (int count, int dum2),
  34.   rl_unix_word_rubout (int dum1, int dum2),
  35.   rl_yank (int dum1, int dum2),
  36.   rl_backward_word (int count, int dum2),
  37.   rl_kill_word (int count, int dum2),
  38.   rl_forward_word (int count, int dum2),
  39.   rl_tab_insert (int count, int dum2),
  40.   rl_yank_pop (int dum1, int dum2),
  41.   rl_yank_nth_arg (int count, int ignore),
  42.   rl_backward_kill_word (int count, int dum2),
  43.   rl_backward_kill_line (int direction, int dum2),
  44.   rl_transpose_words (int count, int dum2),
  45.   rl_complete (int ignore, int invoking_key), 
  46.   rl_possible_completions (int dum1, int dum2), 
  47.   rl_do_lowercase_version (int ignore1, int ignore2), 
  48.   rl_undo_command (int count, int dum2),
  49.   rl_revert_line (int dum1, int dum2),
  50.   rl_beginning_of_history (int dum1, int dum2),
  51.   rl_end_of_history (int dum1, int dum2), 
  52.   rl_forward_search_history (int sign, int key), 
  53.   rl_insert (int count, int c),
  54.   rl_upcase_word (int count, int dum2), 
  55.   rl_downcase_word (int count, int dum2),
  56.   rl_capitalize_word (int count, int dum2),
  57.   rl_restart_output (int count, int key), 
  58.   rl_re_read_init_file (int count, int ignore),
  59.   rl_digit_argument (int ignore, int key), 
  60.   rl_universal_argument (int dum1, int dum2),
  61.   rl_abort (int dum1, int dum2),
  62.   rl_unix_line_discard (int dummy1, int dummy2),
  63.   rl_quoted_insert (int count, int dum2),
  64.   rl_rubout (int count, int dummy);
  65.  
  66. extern int ding (void);
  67.  
  68. /* These are *both* defined even when VI_MODE is not. */
  69. extern void rl_vi_editing_mode (int dum1, int dum2),
  70.   rl_emacs_editing_mode (int dum1, int dum2);
  71.  
  72. #ifdef VI_MODE
  73. /* Things for vi mode. */
  74. extern void rl_vi_movement_mode (int dum1, int dum2),
  75.    rl_vi_insertion_mode (int dum1, int dum2),
  76.    rl_vi_arg_digit (int dum1, int dum2),
  77.    rl_vi_prev_word (int dum1, int dum2),
  78.    rl_vi_next_word (int dum1, int dum2),
  79.    rl_vi_char_search (int dum1, int dum2),
  80.    rl_vi_eof_maybe (int dum1, int dum2),
  81.    rl_vi_append_mode (int dum1, int dum2),
  82.    rl_vi_put (int dum1, int dum2),
  83.    rl_vi_append_eol (int dum1, int dum2),
  84.    rl_vi_insert_beg (int dum1, int dum2),
  85.    rl_vi_delete (int dum1, int dum2),
  86.    rl_vi_comment (int dum1, int dum2),
  87.    rl_vi_first_print (int dum1, int dum2),
  88.    rl_vi_fword (int dum1, int dum2),
  89.    rl_vi_fWord (int dum1, int dum2),
  90.    rl_vi_bword (int dum1, int dum2),
  91.    rl_vi_bWord (int dum1, int dum2),
  92.    rl_vi_eword (int dum1, int dum2),
  93.    rl_vi_eWord (int dum1, int dum2),
  94.    rl_vi_end_word (int dum1, int dum2),
  95.    rl_vi_change_case (int dum1, int dum2),
  96.    rl_vi_match (int dum1, int dum2),
  97.    rl_vi_change_char (int dum1, int dum2),
  98.    rl_vi_yank_arg (int dum1, int dum2),
  99.    rl_vi_search (int dum1, int dum2),
  100.    rl_vi_search_again (int dum1, int dum2),
  101.    rl_vi_subst (int dum1, int dum2),
  102.    rl_vi_overstrike (int dum1, int dum2),
  103.    rl_vi_overstrike_delete (int dum1, int dum2),
  104.    rl_vi_replace(int dum1, int dum2),
  105.    rl_vi_column (int dum1, int dum2),
  106.    rl_vi_delete_to (int dum1, int dum2),
  107.    rl_vi_change_to (int dum1, int dum2),
  108.    rl_vi_yank_to (int dum1, int dum2),
  109.    rl_vi_complete (int dum1, int dum2);
  110. extern void   rl_vi_dosearch (int dum1, int dum2);
  111. extern void   rl_vi_check (void);
  112. extern int rl_vi_bracktype (int dum1);
  113. #endif /* VI_MODE */
  114.  
  115. /* Keyboard macro commands. */
  116. extern void rl_start_kbd_macro (int ignore1, int ignore2), 
  117.   rl_end_kbd_macro (int count, int ignore), 
  118.   rl_call_last_kbd_macro (int count, int ignore);
  119.  
  120. extern void rl_arrow_keys(int count, int c),
  121.   rl_refresh_line (int dum1, int dum2);
  122.  
  123. /* Maintaining the state of undo.  We remember individual deletes and inserts
  124.    on a chain of things to do. */
  125.  
  126. /* The actions that undo knows how to undo.  Notice that UNDO_DELETE means
  127.    to insert some text, and UNDO_INSERT means to delete some text.   I.e.,
  128.    the code tells undo what to undo, not how to undo it. */
  129. enum undo_code { UNDO_DELETE, UNDO_INSERT, UNDO_BEGIN, UNDO_END };
  130.  
  131. /* What an element of THE_UNDO_LIST looks like. */
  132. typedef struct undo_list {
  133.   struct undo_list *next;
  134.   int start, end;        /* Where the change took place. */
  135.   char *text;            /* The text to insert, if undoing a delete. */
  136.   enum undo_code what;        /* Delete, Insert, Begin, End. */
  137. } UNDO_LIST;
  138.  
  139. /* The current undo list for RL_LINE_BUFFER. */
  140. extern UNDO_LIST *rl_undo_list;
  141.  
  142. /* The data structure for mapping textual names to code addresses. */
  143. typedef struct {
  144.   char *name;
  145.   KFunction *function;
  146. } FUNMAP;
  147.  
  148. extern FUNMAP **funmap;
  149.  
  150. /* **************************************************************** */
  151. /*                                    */
  152. /*            Well Published Variables            */
  153. /*                                    */
  154. /* **************************************************************** */
  155.  
  156. /* The name of the calling program.  You should initialize this to
  157.    whatever was in argv[0].  It is used when parsing conditionals. */
  158. extern char *rl_readline_name;
  159.  
  160. /* The line buffer that is in use. */
  161. extern char *rl_line_buffer;
  162.  
  163. /* The location of point, and end. */
  164. extern int rl_point, rl_end;
  165.  
  166. /* The name of the terminal to use. */
  167. extern char *rl_terminal_name;
  168.  
  169. /* The input and output streams. */
  170. extern FILE *rl_instream, *rl_outstream;
  171.  
  172. /* The basic list of characters that signal a break between words for the
  173.    completer routine.  The initial contents of this variable is what
  174.    breaks words in the shell, i.e. "n\"\\'`@$>". */
  175. extern char *rl_basic_word_break_characters;
  176.  
  177. /* The list of characters that signal a break between words for
  178.    rl_complete_internal.  The default list is the contents of
  179.    rl_basic_word_break_characters.  */
  180. extern char *rl_completer_word_break_characters;
  181.  
  182. /* List of characters that are word break characters, but should be left
  183.    in TEXT when it is passed to the completion function.  The shell uses
  184.    this to help determine what kind of completing to do. */
  185. extern char *rl_special_prefixes;
  186.  
  187. /* Pointer to the generator function for completion_matches ().
  188.    NULL means to use filename_entry_function (), the default filename
  189.    completer. */
  190. extern CFunction *rl_completion_entry_function;
  191.  
  192. /* If rl_ignore_some_completions_function is non-NULL it is the address
  193.    of a function to call after all of the possible matches have been
  194.    generated, but before the actual completion is done to the input line.
  195.    The function is called with one argument; a NULL terminated array
  196.    of (char *).  If your function removes any of the elements, they
  197.    must be free()'ed. */
  198. extern CCFunction *rl_ignore_some_completions_function;
  199.  
  200. /* Pointer to alternative function to create matches.
  201.    Function is called with TEXT, START, and END.
  202.    START and END are indices in RL_LINE_BUFFER saying what the boundaries
  203.    of TEXT are.
  204.    If this function exists and returns NULL then call the value of
  205.    rl_completion_entry_function to try to match, otherwise use the
  206.    array of strings returned. */
  207. extern UFunction *rl_attempted_completion_function;
  208.  
  209. /* If non-null, this contains the address of a function to call if the
  210.    standard meaning for expanding a tilde fails.  The function is called
  211.    with the text (sans tilde, as in "foo"), and returns a malloc()'ed string
  212.    which is the expansion, or a NULL pointer if there is no expansion. */
  213. extern char *(*rl_tilde_expander)(char *);
  214.  
  215. /* If non-zero, then this is the address of a function to call just
  216.    before readline_internal () prints the first prompt. */
  217. extern VFunction *rl_startup_hook;
  218.  
  219. /* If non-zero, then this is the address of a function to call when
  220.    completing on a directory name.  The function is called with
  221.    the address of a string (the current directory name) as an arg. */
  222. extern CCFunction *rl_symbolic_link_hook;
  223.  
  224. /* Non-zero means that modified history lines are preceded
  225.    with an asterisk. */
  226. extern int rl_show_star;
  227.  
  228. /* **************************************************************** */
  229. /*                                    */
  230. /*            Well Published Functions            */
  231. /*                                    */
  232. /* **************************************************************** */
  233.  
  234. /* Read a line of input.  Prompt with PROMPT.  A NULL PROMPT means none. */
  235. extern char *rl_readline (char *prompt);
  236.  
  237. /* Return an array of strings which are the result of repeatadly calling
  238.    FUNC with TEXT. */
  239. extern char **completion_matches (char *text, CFunction *entry_function);
  240.  
  241. /* rl_add_defun (char *name, Function *function, int key)
  242.    Add NAME to the list of named functions.  Make FUNCTION
  243.    be the function that gets called.
  244.    If KEY is not -1, then bind it. */
  245. extern void rl_add_defun (char *name, KFunction (*function), int key);
  246.  
  247. #endif /* _READLINE_H_ */
  248.